#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#include <ctime>

#include "kahansum.h"
#include "LinearClassifier.h"
#include "median.h"
#include "Vector.h"
#include "utils.h"
#include "kmeans.h"
#include "MLP.h"
#include "SangerRule.h"
using namespace std;

int main0 ()
{
	vector<DMVector> vlist;
	vector<int> vp;
	KMeans kmean(8);
	int i;
	srand( (unsigned)time( NULL ) );


	vlist = read_data ( "out-1-1");
	kmean.init_cluster_center ( vlist );	//use k-means
	cout << kmean.clusterize ( vlist ) << endl;

	vp.clear();
	for ( i = 0; i < vlist.size(); ++i )
		vp.push_back ( kmean.get_point_id(i) );

	write_data ( "out-1-10", vlist, vp );

	cout << kmean.DBI ( vlist ) << endl;	//lower is better
	cout << kmean.DI ( vlist ) << endl;		//higher is better

	
	kmean.kmpp_init ( vlist );				//use k-means++
	//cout << kmean.clusterize ( vlist ) << endl;

	vp.clear();
	for ( i = 0; i < vlist.size(); ++i )
		vp.push_back ( kmean.get_point_id(i) );

	write_data ( "out-1-11", vlist, vp );

	cout << kmean.DBI ( vlist ) << endl;
	cout << kmean.DI ( vlist ) << endl;

	return 0;
}
